<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
  <meta charset="utf-8">
  <title></title>
  <style media="screen">
    * {
      padding: 0;
      margin: 0;
    }

    .layout {
      margin-top: 20px;
    }

    .layout article div {
      min-height: 100px;
    }
  </style>
</head>

<body>
  <!-- float解决方案 -->
  <section class="layout float">
    <style media="screen">
      .layout.float .left {
        float: left;
        width: 300px;
        background: red;
      }

      .layout.float .right {
        float: right;
        width: 300px;
        background: blue;
      }

      .layout.float .center {
        background: #ff0;
      }
    </style>
    <article class="left-right-center">
      <div class="left">1.这是三栏中的中间部分</div>

      <div class="right">1.这是三栏中的中间部分</div>
      <div class="center">
        <h1>浮动布局</h1>
        1.这是三栏中的中间部分

      </div>
    </article>
  </section>

  <section class="layout absolute">
    <style media="screen">
      .layout.absolute .left-center-right>div {
        position: absolute;
      }

      .layout.absolute .left {

        left: 0;
        width: 300px;
        background: red;
      }

      .layout.absolute .center {
        left: 300px;
        right: 300px;
        background: #ff0;
      }

      .layout.absolute .right {
        right: 0;
        width: 300px;
        background: blue;
      }
    </style>

    <article class="left-center-right">
      <div class="left">1.这是三栏中的中间部分</div>
      <div class="center">
        <h1>绝对布局</h1>
        1.这是三栏中的中间部分
      </div>
      <div class="right">1.这是三栏中的中间部分</div>
    </article>
  </section>

  <!-- flexbox解决方案 -->
  <section class="layout flexbox">
    <style media="screen">
      .layout.flexbox {
        margin-top: 200px;
      }

      .layout.flexbox .left-center-right {
        display: flex;
      }

      .layout.flexbox .left {
        width: 300px;
        background: red;
      }

      .layout.flexbox .center {
        flex: 1;
        background: yellow;
      }

      .layout.flexbox .right {
        width: 300px;
        background: blue;
      }
    </style>
    <article class="left-center-right">
      <div class="left">1.这是三栏中的中间部分</div>
      <div class="center">
        <h1>flex布局</h1>
      </div>
      <div class="right">3.这是三栏中的中间部分</div>
    </article>
  </section>
  <!-- 表格布局解决方案 -->
  <section class="layout table">
    <style media="screen">
      .layout.table .left-center-right {
        width: 100%;
        display: table;
        height: 100px;
      }

      .layout.table .left-center-right>div {
        display: table-cell;
      }

      .layout.table .left {
        width: 300px;
        background: red;
      }

      .layout.table .center {
        background: yellow;
      }

      .layout.table .right {
        width: 300px;
        background: blue;
      }
    </style>
    <article class="left-center-right">
      <div class="left">1.这是三栏中的中间部分</div>
      <div class="center">
        <h1>表格布局</h1>
        1.这是三栏中的中间部分
      </div>
      <div class="right">1.这是三栏中的中间部分</div>
    </article>
  </section>
  <section class="layout grid">
    <style media="screen">
      .layout.grid .left-center-right {
        display: grid;
        width: 100%;
        grid-template-rows: 100px;
        grid-template-columns: 300px auto 300px;
      }

      .layout.grid .left {
        background: red;
      }

      .layout.grid .center {
        background: yellow;
      }

      .layout.grid .right {
        background: blue;
      }
    </style>
    <article class="left-center-right">
      <div class="left">1.这是三栏中的中间部分</div>
      <div class="center">
        <h1>网格布局</h1>
        1.这是三栏中的中间部分
      </div>
      <div class="right">1.这是三栏中的中间部分</div>
    </article>
  </section>

<section><style media="screen">
    .father{
      margin: 0 auto;
      margin-bottom: 30px;
      width: 300px;
      height: 100px;
      background: #ff0;
    }
    .son{
      margin-top: 20px;
      overflow: hidden;
      width: 50px;
      height: 50px;
      background: #f00000;
    }
  </style>
  <article>
  <div class="father">
    <p class="son">
      123
    </p>
  </article>
</div>
</section>
</body>

</html>